from appium import webdriver


def driver_setup():
    desired_caps = dict()
    desired_caps['platformName'] = 'Android'
    desired_caps['platformVersion'] = '12'
    desired_caps['deviceName'] = 'H4K5T21107017709'
    # desired_caps['deviceName'] = '10AD9D28QM00AEL'  # vivo手机
    # desired_caps['deviceName'] = 'RF8M726AZQB'
    desired_caps['appPackage'] = 'com.hanvonscanner.app'
    desired_caps['appActivity'] = '.views.my.SplashActivity'
    desired_caps['noReset'] = True  # 不重置session信息
    desired_caps['fullReset'] = False  # 效果类似与卸载APP 如果不想每次重新登录，设为False
    desired_caps['unicodeKeyboard'] = False  # 使用自带输入法，输入中文时填True
    desired_caps['resetKeyboard'] = False  # 执行完程序恢复原来输入法
    driver = webdriver.Remote('http://localhost:4723/wd/hub', desired_caps)
    return driver


if __name__ == "__main__":
    driver_setup()
